<template>
  <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="执行时间戳">
        <el-input v-model="form.timestamp" placeholder="请输入执行时间戳" />
      </el-form-item>
      <el-form-item>
        <el-button @click="submit">确定</el-button>
        <el-button @click="cancel">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      title: this.titleP,
      form: {
        timestamp: new Date().getTime(),
      },
    };
  },
  props: {
    titleP: "",
    openP: false,
  },
  created() {},
  computed: {
    open: {
      set: function (value) {
        this.$emit("on-cancel", this.form.timestamp);
      },
      get: function () {
        return this.openP;
      },
    },
  },
  methods: {
    submit() {
      this.$emit("on-submit", this.form.timestamp);
    },
    cancel() {
      this.$emit("on-cancel", this.form.timestamp);
    },
  },
};
</script>